<template>
  <div>
    <h1>接收到的ID是 {{goodsid.goodsid}}</h1>
      <el-table
      :data="goodsid.goodslist"
      border
      highlight-current-row>
      <el-table-column align="center" label="ID" width="95" sortable>
        <template slot-scope="scope">
          {{ scope.$index }}
        </template>
      </el-table-column>
      <el-table-column align="center" label="货品名称" sortable>
        <template slot-scope="scope">
          <!-- <i class="el-icon-time"/> -->
          {{ scope.row.goodsname }}
        </template>
      </el-table-column>
      <el-table-column align="center" label="规格" >
        <template slot-scope="scope">
          {{ scope.row.goodstype }}
        </template>
      </el-table-column>
      <el-table-column align="center" label="生产厂家" >
        <template slot-scope="scope">
          <el-input v-show="scope.row.edit" size="small" v-model="scope.row.factoryname"></el-input>
          <span v-show="!scope.row.edit">{{ scope.row.factoryname }}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="编辑" width="120">
      <template  slot-scope="scope">
          <el-button v-show='!scope.row.edit' type="primary" @click='scope.row.edit=true' size="small" icon="edit">编辑</el-button>
          <el-button v-show='scope.row.edit' type="success" @click='scope.row.edit=false' size="small" icon="check">完成</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: {
    goodsid: {
      type: Object,
      default() {
        return {};
      }
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
